package com.gyg.controller;
import com.gyg.domain.CloudMessage;
import com.gyg.returns.RespEntity;
import com.gyg.service.CloudMessageService;
import com.gyg.vo.param.MessageParam;
import com.gyg.vo.result.MessageResult;
import io.swagger.annotations.Api;
import java.util.List;

import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * <p>
 * 云盘消息表 前端控制器
 * </p>
 *
 * @author gyg
 * @since 2021-04-14
 */
@RestController
@RequestMapping("/cloud-message")
@Api(value = "公告模块", tags = "公告模块")
public class CloudMessageController {

    @Resource
    private CloudMessageService cloudMessageService;

    @GetMapping("/list")
    @ApiOperation(value = "公告列表")
    public RespEntity<List<MessageResult>> messageList() {
        RespEntity<List<MessageResult>> respEntity = cloudMessageService.cloudMessageList();
        return respEntity;
    }

    @PostMapping("/insert")
    @ApiOperation(value = "发布公告")
    public RespEntity publishMessage(@RequestBody MessageParam messageParam) {
        RespEntity respEntity = cloudMessageService.insertMessage(messageParam);
        return respEntity;
    }

}
